/*
 * T.Raynal - A.Aviles - F.Diallo
 * XML-Scenarios
 * PPA AL5-2
 * December 2012 
 */
package trash;

public class GNode<T> {

	private GNode<T> _parent;
	private GNode<T> _right;
	private GNode<T> _left;
	T _value;
	
	public GNode (T value)
	{
		_parent = null;
		_value = value;
	}
	
	protected GNode<T> setParent (GNode<T> parent)
	{
		_parent = parent;
		return _parent;
	}
	
	public GNode (GNode<T> parent, T value)
	{
		_parent = parent;
		_value = value;
	}
	
	public GNode (GNode<T> parent,T value, GNode<T> right, GNode<T> left)
	{
		_parent = parent;
		_right = right;
		_left = left;
		_value = value;
	}

	public GNode<T> getParent() {
		return _parent;
	}
	
	public T getValue() {
		return _value;
	}
	
	public GNode<T> getRight() {
		return _right;
	}

	public GNode<T> setRight(GNode<T> gNode) {
		this._right = gNode;
		gNode.setParent(this);
		return _right;
	}

	public GNode<T> getLeft() {
		return _left;
	}

	public GNode<T> setLeft(GNode<T> gNode) {
		this._left = gNode;
		gNode.setParent(this);
		return _left;
	}

}
